#!/usr/bin/php
<?php
/*
 *   This file is part of verbum.
 *
 *   verbum is free software: you can redistribute it and/or modify
 *   it under the terms of the GNU General Public License as published by
 *   the Free Software Foundation, either version 3 of the License, or
 *   (at your option) any later version.
 *
 *   verbum is distributed in the hope that it will be useful,
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *   GNU General Public License for more details.
 *
 *   You should have received a copy of the GNU General Public License
 *   along with verbum.  If not, see <http://www.gnu.org/licenses/>.
 *   
 *   Copyright (c) 2008 Sergio Gabriel Teves <gabriel.sgt at gmail.com>
 * */
 
$cadena = dirname(__FILE__);
$fpos = strrpos($cadena, "/");
if ($fpos<=0) {
	$cadena = str_replace("\\","/",$cadena);
	$fpos = strrpos($cadena, "/");
}

define("BASH_PATH",substr($cadena, 0, $fpos)."/");
define("PATH","/var/www/vhosts/verbum/data");

require_once(BASH_PATH."configs/dbconf.php");
/* USO UN PHP PARA LLAMAR AL PY PORQUE NO QUIERO ESCRIBIR LOS DATOS DE LA DB DOS VECES
 * Y ADEMAS QUIERO QUE EL SCRIPT DE BACKUP SEA EN PYTHON, PORQUE SI.
 */
exec(BASH_PATH."bash/dbbackup.py ".DB_USER." ".DB_PASS." ".DB_NAME." ".DB_HOST." ".PATH,$out);

foreach ($out as $o) {
	print $o;
}

?>
